<?php

$sBasePath = dirname(dirname(__FILE__).DIRECTORY_SEPARATOR);
$aDatabase = require_once($sBasePath.'/config/server.php');

return array
(
    'basePath'          => $sBasePath,
    'name'              => 'iFin.by',
    'defaultController' => 'default',
    'theme'             => 'default',
    'language'          => 'ru',
    'import'            => array
    (
        'application.controllers.*',
        'application.components.*',
        'application.models.*',
        'application.extensions.upload.Upload',
        'application.extensions.mail.YiiMailMessage'
    ),
    'modules' => array
    (
        'news',
        'rumors',
    	'profile' => array
        (
            'access' => array('user')
        ),
        'admin' => array
        (
            'access' => array('administrator')
        )
    ),
    'components' => array
    (
        'errorHandler'=>array(
            'errorAction'=>'default/error',
        ),
        'authManager'  => array
        (
            'class'           => 'CDbAuthManager',
            'connectionID'    => 'db',
            'itemTable'       => $aDatabase['tablePrefix'].'auth_item',
            'itemChildTable'  => $aDatabase['tablePrefix'].'auth_item_child',
            'assignmentTable' => $aDatabase['tablePrefix'].'auth_assignment',
            'defaultRoles'    => array('guest')
        ),
        'themeManager' => array
        (
            'themeClass' => 'CCustomTheme',
            'basePath'   => dirname(dirname(dirname(__FILE__))).'/themes/',
            'baseUrl'    => '/themes/'
        ),
        'db'   => $aDatabase,
        'user' => array
        (
            'class'          => 'CCustomWebUser',
            'allowAutoLogin' => true,
            'loginUrl'       => array('login')
        ),
        'urlManager' => array
        (
            'showScriptName' => false,
            'urlFormat'      => 'path',
            'urlSuffix'      => '.html',
        	'caseSensitive'	 =>false,
            'rules'          => array
            (
                'login'              		=> 'default/login',
                'logout'             		=> 'default/logout',
                'news/<news_id:\d+>' 		=> 'news/default/view',
                'rumors/<rumor_id:\d+>' 	=> 'rumors/default/view',
                'register'           		=> 'default/register',
                'register2'           		=> 'default/register2',
                'register2_success'             => 'default/register2_success',
                'register2_confirm'             => 'default/register2_confirm',
                'about'                         => 'default/about',
                'contact'                       => 'default/contact',
                'partner'                       => 'default/partner',
                'map'                           => 'default/map',
                'terms_of_use'                  => 'default/terms_of_use',
                'right'                         => 'default/right',
                'ads'                           => 'default/ads',
                'tariffs'                       => 'default/tariffs',
                'sale'                          => 'default/sale',
                'purchase'                      => 'default/purchase',
                'legal'                         => 'default/legal',
                'thankyou'                      => 'default/thankyou',
                'statistics'                    => 'default/statistics',
                'metals'                        => 'default/metals',
                'captcha'                       => 'default/captcha',
                'currency'                       => 'default/currency',
                'sale2'                          => 'default/sale2',
            )
        ),
        'mail' => array
        (
            'class'         => 'application.extensions.mail.YiiMail',
            'transportType' => 'php',
            //'viewPath'      => 'application.views.mail',
            'logging'       => false,
            'dryRun'        => false
 	)
    ),
    'params' => array
    (
        'password_sold' => 'x;se,od!chh;o=htnXAZ{g[r,gpzr,g',
        'ifin_email'    => 'info@ifin.by',
        'default_meta'  => array(
            'title' => '',
            'keywords' => '',
            'description' => '',
        )
    )
);